Random numbers are those which when put in series have no pattern in their progression. Typical examples of use of random numbers are: Monte Carlo simulations of naturally random phenomena such as particle interactions and transport, lattice theory calculations, statistical mathematics for evaluation of results of calculations for which the theoretical evaluation seems to be beyond reach, simulations in engineering of nuclear power plants, cryptography for generation of passwords, public keys and secure data transfer protocols.
There are two distinct categories of random numbers, pseudo-random numbers, and true random numbers. Pseudo-random numbers are generally calculated by using an algorithm. In contrast, true random numbers typically obtained from a source of entropy.
Pseudo-random numbers are not truly random. Rather, they are computed from a mathematical formula or simply taken from a pre-calculated list. When using the mathematical formula to generate a sequence of pseudo-random numbers each pseudo-random number is dependent on the previous random number generated. Thus, pseudo-random numbers have the characteristic that they are predictable, i.e., pseudo-random numbers can be predicted if one can determine where in the sequence the first number is taken from.
Pseudo-random numbers are typically generated using a pseudo-random number generator. A number known as the seed is provided to the pseudo-random number generator as an initial number to pass through the formula. Seeds for pseudo-random number generators are usually produced by using some aspect of system time e.g., the time on a system clock when the request for a seed was made by the pseudo-random number generator. The output of the pseudo-random number generator is predictable because each value returned by the pseudo-random number generator is completely determined by the previous value returned and ultimately, the seed from which the pseudo-random number was initially derived. If the number used to compute any one value is known, then every subsequent value returned from the generator may be derived.
While pseudo-random numbers are predicable, pseudo-random numbers do have many useful applications. Pseudo-random numbers work well for Monte Carlo simulations and other statistical sampling or simulation models. Monte Carlo simulations are a group of methods that use pseudo-random numbers to simulate physical events or to solve mathematical problems. These applications typically require only moderate sophistication in their randomness, requiring only that patterns in a sequence don't correspond with naturally occurring sequences.
True random numbers are typically produced by hardware random number generators. True random numbers are non-deterministic, i.e., an external observer should never be able to predict the output of such a device with any consistency, even if the algorithm used by the device is known. For example, if the device generates a series of 0's and 1's, a 0 and a 1 should be equally as likely to occur in the output. Even with complete knowledge of the inner workings of the device, any guess will be right exactly 50% of the time (over some range of behavior).
True random numbers display the properties of uniformity, summation, duplication, and independence. Uniformity is defined as producing an unbiased set of random numbers. For example, if random numbers between 0 and 999 are to be generated then to preserve uniformity no more than half the random numbers should be between 0 and 499. Independence occurs when the random numbers within a set cannot be correlated. Thus, if it is possible to predict something about the next value in the set of random numbers, given that the previous values are known, then the set of numbers is not random. Thus, the probability of observing each value is independent of the previous values. Summation occurs when the sum of two consecutive random numbers is equally likely to be even or odd. Duplication occurs when the repeated numbers are repeated. A set of numbers is not truly random unless the set of numbers displays all of the aforementioned properties.
The quality of randomness of a set of numbers can be measured in a variety of ways. One common method is to compute the information density, or entropy, in a series of numbers. The higher the entropy in a series of numbers, the more difficult it is to predict any selected number on the basis of the preceding numbers in the series. A sequence with a high quality of random numbers will have a high level of entropy.
As previously stated, true random numbers are typically generated by sampling. Entropy is a measure of the disorder, or randomness, of a system. A system having of entropy may be very simple, e.g., the amount of time between keystrokes on a computer keyboard. In practice, however, user input as a source of entropy may be difficult to use. Keystrokes, for example, are often buffered by the computer's operating system, meaning that several keystrokes are collected before they are sent to the program waiting for them. There are many additional sources of entropy, e.g., Random.org, www.random.org, designed and maintained by The Department of Computer Science, Trinity College, Dublin Ireland, uses atmospheric noise from a radio as a source of entropy, and Fourmilab, www.fourilab.ch/hotbits/based in Switzerland uses timing successive pairs of radioactive decays as a source of entropy.